/*******************************************************************************
 * Copyright (c) 2018 Johannes Kepler University
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *  Alois Zoitl - initial implementation and rework communication infrastructure
 *******************************************************************************/

#pragma once

#include "forte/funcbloc.h"
#include "forte/device.h"
#include "forte/devexec.h"
#include "forte/extevhan.h"

namespace forte::util {
  /*!\brief Get an external event handler by finding the device a FB is contained in
   *
   */
  template<typename T>
  T &getExtEvHandler(CFunctionBlock &paFB) {
    return paFB.getDevice()->getDeviceExecution().getExtEvHandler<T>();
  }
} // namespace forte::util
